home *** CD-ROM | disk | FTP | other *** search
-
-
- 100 'KALEIDOSCOPE - JOHN SCHNELL - AUGUST 82
- 110 CLS
- 120 '
- 130 DEFINT A-Z
- 140 '
- 150 'initialize random number generator using MINUTES and SECONDS of TIME$ variable
- 160 N=VAL(MID$(TIME$,4,2)+MID$(TIME$,7,2)) MOD 32767
- 170 RANDOMIZE(N)
- 180 '
- 190 'initialize CHARACTER and ATTRIBUTE arrays
- 200 OPTION BASE 0
- 210 DIM C$(4),A(1)
- 220 C$(0)=CHR$(32) 'character for black (space)
- 230 C$(1)=CHR$(176) 'character for gray-value one
- 240 C$(2)=CHR$(177) 'character for gray-value two
- 250 C$(3)=CHR$(178) 'character for gray-value three
- 260 C$(4)=CHR$(219) 'character for white
- 270 A(0)=7 'attribute for normal intensity
- 280 A(1)=10 'attribute for high intensity
- 290 '
- 300 'setup screen
- 310 KEY OFF 'turn function key display off
- 320 COLOR 7,0
- 330 LOCATE 25,14,0 'set cursor on line 25 and turn cursor off
- 340 PRINT"*** push <space-bar> to clear screen or <X> to exit ***";
- 350 '
- 360 'initialize V and H to near center of screen
- 370 V=13-RND(RND(13*RND(1))) : H=40-RND(RND(40*RND(1)))
- 380 '
- 390 'calculate next V,H position
- 400 VV=V : HH=H 'save old value for V and H
- 410 V=V+4*RND(1)-2 'move up, down, or stay
- 420 IF V<1 OR V>12 THEN V=VV : GOTO 410 'check vertical plot range
- 430 H=H+4*RND(1)-2 'move left, right, or stay
- 440 IF H<1 OR H>39 THEN H=HH : GOTO 430 'check horizontal plot range
- 450 IF 30*RND(1)<28 THEN 490 'random shot to relocate plot
- 460 V=13*RND(1)+1 : H=40*RND(1)+1 'calculate new random position
- 470 '
- 480 'determine next character to plot
- 490 ATTRIB=A(RND(1)) 'get random attribute
- 500 CHAR=4*RND(1) 'get random character
- 510 '
- 520 'play note and plot kaleidoscope
- 530 SOUND V*H*5+37,1 'play sound using V and H
- 540 COLOR ATTRIB,0 'set attribute mode
- 550 LOCATE V,H
- 560 PRINT C$(CHAR);
- 570 LOCATE 24-V,H
- 580 PRINT C$(CHAR);
- 590 LOCATE V,80-H
- 600 PRINT C$(CHAR);
- 610 LOCATE 24-V,80-H
- 620 PRINT C$(CHAR);
- 630 '
- 640 'check if blank screen or exit is requested
- 650 RESP$=INKEY$
- 660 IF RESP$=" " THEN COLOR 7,0 : CLS : GOTO 320
- 670 IF RESP$="X" OR RESP$="x" THEN 710
- 680 GOTO 400
- 690 '
- 700 'restore everything before quitting
- 710 COLOR 7,0
- 720 CLS
- 730 KEY ON
- 740 RUN "MENU.PGM"
- $="x" THEN 710
- 680 GOTO 400